﻿using AutoMapper;
using Budget.Core.DomainModel;
using Budget.Wcf.Core.Dto;

namespace Budget.Wcf.Core.AutoMapper
{
    public static class AutoMapperConfiguration
    {
        public static void Configure()
        {
            Mapper.CreateMap<CategoryData, Category>().ReverseMap();
            Mapper.CreateMap<BalanceData, Balance>().ReverseMap();
            Mapper.CreateMap<ProductData, Product>().ReverseMap();
            Mapper.CreateMap<OutcomeOrderData, OutcomeOrder>().ReverseMap();
            Mapper.CreateMap<IncomeTypeData, IncomeType>()
                .ForMember(it => it.IncomeOrders, a => a.Ignore())
                .ReverseMap();
            Mapper.CreateMap<IncomeOrderData, IncomeOrder>()
                .ForMember(o => o.Id, a => a.Ignore())
                .ReverseMap();
            Mapper.CreateMap<IncomeOrder, IncomeOrderData>().ReverseMap();
        }
    }
}